<template>
  <div class="tabs">
    <van-tabs v-model="active">
      <van-tab
        v-for="(item, index) in TabTitle"
        :title="item.title"
        :key="index"
        :to="item.to"
      ></van-tab>
    </van-tabs>
  </div>
</template>



<script>
import { Tab, Tabs } from "vant";
export default {
  name: "tabs",
  props: ["tatitles"],
  components: {
    [Tab.name]: Tab,
    [Tabs.name]: Tabs,
  },
  // props: ["news"],

  data() {
    return {
      indexdata: [],
      active: this.$route.meta.active,
      //   TabTitle: ["关注", "推荐", "热门"],
      TabTitle: [],
      // 不需要返回按钮的页面
    };
  },
  watch: {
    tatitles(val) {
      console.log(val);
      this.TabTitle = val;
      console.log(this.TabTitle);
      this.$forceUpdate();
    },
  
  },
  mounted() {
    // console.log(this.$refs.news.getMsg(this.indexdata
    // ))
    console.log(this.TabTitle);
  },
  methods: {
    //  二级路由导航部分
  },
};
</script>

<style lang="less">
.tabs {
  .van-tabs {
    .van-tabs__wrap {
      height: 25px;
    }
  }
}
</style>